﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:services="clr-namespace:ApartmentBillsManager.Start.Services">
    
    <DataTemplate DataType="{x:Type services:CreateEditRoommate}">
        <StackPanel Orientation="Vertical" FlowDirection="RightToLeft">
            
            <ItemsControl ItemContainerStyle="{DynamicResource DefaultMargins}">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <Grid Margin="20">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="25"/>
                                <ColumnDefinition Width="105"/>
                                <ColumnDefinition Width="120"/>
                            </Grid.ColumnDefinitions>

                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                        </Grid>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>

                <TextBlock Grid.Row="0" Grid.Column="1" Text="שם:"/>
                <TextBox Grid.Row="0" Grid.Column="2" Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}"/>

                <TextBlock Grid.Row="1" Grid.Column="1" Text="תאריך כניסה:"/>
                <DatePicker Grid.Row="1" Grid.Column="2" SelectedDate="{Binding DateOfEntrance, UpdateSourceTrigger=PropertyChanged}"/>

                <CheckBox Grid.Row="2" Grid.Column="0" VerticalAlignment="Center"  IsChecked="{Binding IsDateOfLeavingRelevat}"/>
                <TextBlock Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" Text="תאריך עזיבה:"/>
                <DatePicker Grid.Row="2" Grid.Column="2" VerticalAlignment="Center" SelectedDate="{Binding DateOfLeaving}" IsEnabled="{Binding IsDateOfLeavingRelevat, Mode=OneWay}"/>

            </ItemsControl>

            <DockPanel HorizontalAlignment="Center" LastChildFill="False" Width="100" Margin="10">
                <Button DockPanel.Dock="Right" Content="בטל" Command="{Binding CancelRoommateButtonCommand}"/>
                <Button DockPanel.Dock="Left" Content="הוסף" Command="{Binding AddRoommateButtonCommand}" IsEnabled="{Binding CanAddRoommate}"/>
            </DockPanel>

        </StackPanel>

    </DataTemplate>
    
</ResourceDictionary>